﻿using Abp.Domain.Entities;
using Abp.Domain.Entities.Auditing;
using Abp.Modules;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AbpVueDemo.SystemBase.DictionaryTableManager
{
	/// <summary>
	/// 字典表 持久对象, 代表数据库中的一个表  lzh
	/// 继承Entity<int>  int代表主键类型
	/// </summary>
	[Table("dictionary_table")]
    public class DictionaryTable: AuditedEntity<int>
	{
		#region Model
		/// <summary>
		/// 主键
		/// </summary>
		[Key]
		[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
		public override int Id
		{
			get; set;
		}

		/// <summary>
		/// 字典key
		/// </summary>
		[Required]
		[StringLength(100)]
		public string dt_key
		{
			get; set;
		}

		/// <summary>
		/// 字典类别key
		/// </summary>
		[Required]
		[StringLength(100)]
		[ForeignKey("DictionaryTypeTable")]
		public string dt_type_key
		{
			get; set;
		}
		/// <summary>
		/// 字典名称
		/// </summary>
		[Required]
		[StringLength(100)]
		public string dt_name
		{
			get; set;
		}
		[Required]
		/// <summary>
		/// 字典状态 1:有效  2:无效
		/// </summary>
		public int dt_status
		{
			get; set;
		}
		/// <summary>
		/// 排序字段
		/// </summary>
		[Required]
		public decimal dt_orderby
		{
			get; set;
		}

		#endregion Model
	//	[ForeignKey("dt_type_key")]
		public DictionaryTypeTable DictionaryTypeTable
		{
			get; set;
		}
	}
}
